import service from '@/utils/request'

export function getExamListService(params) {
    return service({
        url: '/exam/list',
        method: 'post',  // 从 'get' 改为 'post'
        data: params,    // 从 'params' 改为 'data'
    });
}
export function examAddService(params = {}) {
    return service({
      url: "/exam/add",
      method: "post",
      data: params,
    });
  }
export function addExamQuestionService(params = {}) {
    return service({
      url: "/exam/question/add",
      method: "post",
      data: params,
    });
  }

  export function getExamDetailService(examId) {
    return service({
      url: "/exam/detail",
      method: "get",
      params: { examId },
    });
  }
  export function editExamService(params = {}) {
    return service({
      url: "/exam/edit",
      method: "post",
      data: params,
    });
  }
  
  export function delExamQuestionService(examId, questionId) {
    return service({
      url: "/exam/question/delete",
      method: "delete",
      params: { examId, questionId },
    });
  }
  
  export function publishExamService(examId) {
    return service({
      url: "/exam/publish",
      method: "post",
      params: { examId },
    });
  }
  
  export function cancelPublishExamService(examId) {
    return service({
      url: "/exam/cancelPublish",
      method: "post",
      params: { examId },
    });
  }
  
  export function deleteExamService(examId) {
    return service({
      url: "/exam/delete",
      method: "delete",
      params: { examId },
    });
  }
  